<template>
  <main id="main">
    <p class="title">本周积分</p>
    <el-row>
      <el-col class="account">
        <el-card :body-style="{ padding: '0px' }">
          <chart ref="chart1" :options="option" :auto-resize="true" class="integralChart"></chart>
          <p class="score">
            <span class="groupScore">
              小组总分：
              <span>20</span>
            </span>
            <span class="personalScore">
              个人总分：
              <span>20</span>
            </span>
          </p>
        </el-card>
      </el-col>
      <el-col class="rank">
        <el-card :body-style="{ padding: '0px' }">
          <p class="rankTitle">本周积分排行版</p>
            <ul class="infinite-list rankInfo" v-infinite-scroll="load" style="overflow:auto">
              <li v-for="i in count" class="infinite-list-item">
                <span class="num">{{i}}</span>
                <span class="rankName">小明</span>
                <span class="rankScore">200</span>
              </li>
            </ul>
        </el-card>
      </el-col>
    </el-row>
  </main>
</template>

<script>
import echarts from "echarts";
export default {
  data() {
    return {
      option: {},
      count: 0
    };
  },
  mounted() {
    this.option = {
      tooltip: {
        trigger: "axis"
      },
      legend: {
        data: ["小组积分", "个人积分"],
        right: "10",
        top: "10",
        width: "80%"
      },
      grid: {
        left: "1%",
        right: "4%",
        bottom: "3%",
        containLabel: true
      },
      xAxis: {
        type: "category",
        boundaryGap: false,
        data: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"]
      },
      yAxis: {
        type: "value"
      },
      series: [
        {
          name: "小组积分",
          type: "line",
          data: [100, 100, 101, 534, 90, 130, 110]
        },
        {
          name: "个人积分",
          type: "line",
          data: [100, 182, 191, 0, 200, 130, -100]
        }
      ]
    };
  },
  methods: {
     load () {
        this.count += 2;
        console.log(1111);
      }
  }
};
</script>

<style scoped>
.rankInfo {
  margin: 10px;
  height: 60vh;
}
.rankInfo li span {
  display: inline-block;
  width: 30%;
  text-align: center
}

.time {
  font-size: 13px;
  color: #999;
}

.bottom {
  margin-top: 13px;
  line-height: 12px;
}

.button {
  padding: 0;
  float: right;
}

.image {
  width: 100%;
  display: block;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}

.clearfix:after {
  clear: both;
}
.title {
  padding: 20px 0 10px 10px;
  font-size: 18px;
}
.account {
  width: 59%;
}
.rank {
  width: 35%;
}
.account,
.rank {
  margin: 10px;
  height: 80vh;
}
.account > div,
.rank > div {
  width: 100%;
  height: 80vh;
  margin-bottom: 10px;
}
.integralChart {
  max-width: 100%;
  margin: 20px auto;
}
.integralChart:first-child {
  width: 90%;
}
.score {
  margin: 20px 0;
  text-align: center;
  font-size: 16px;
}
.groupScore {
  margin-right: 30px;
}
.rankTitle {
  margin-top: 10px;
  line-height: 40px;
  font-size: 16px;
  text-align: center;
}

</style>